<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        .success_div{
            display: flex;
            justify-content: center;
            align-items: center;
        }

        p{
            font-size: 2.5vw;
        }
    </style>
</head>
<body>

  <div class="success_div">
    <p id="success" th:text="${success}"></p>
  </div>

  <script>
      let second = 3;
      let p = document.getElementById("success");
      window.onload = function(){
          setInterval(function(){
              p.innerText='操作成功，'+second+'秒后回到首页'
              second--;
              if(second == -1){
                  window.location.href='/returnIndex';
              }
          },1000);
      }

  </script>

</body>
</html>